#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>

int main()
{
	char name[1000000] = { 0 };
	int i, n, mid;

	scanf("%s", name);
	mid = strlen(name);
	if (mid % 2 != 0)
		printf("%d", mid);
	else
	{
		for (;mid % 2 == 0;mid /= 2)
		{
			for (i = 0;i < mid / 2;i++)
			{
				if (name[i] == name[mid - 1 - i])
					n = i;
			}

			if (n != (mid / 2 - 1))
				break;
		}

		printf("%d", mid);
	}
	return 0;
}
